package cn.stylefeng.guns.modular.business.frequency.orderabnormal.mapper;

import cn.stylefeng.guns.modular.business.frequency.orderabnormal.model.param.OrderAbnormalDTO;
import cn.stylefeng.guns.modular.business.frequency.orderabnormal.model.result.OrderAbnormalVO;
import cn.stylefeng.guns.modular.business.frequency.orderabnormal.model.result.PkgOrderAbnormal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.business.frequency.orderabnormal.entity.OrderAbnormal;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 订单异常表 Mapper 接口
 *
 * @author yujie
 * @date 2023/05/09 17:17
 */
public interface OrderAbnormalMapper extends BaseMapper<OrderAbnormal> {

    Page<PkgOrderAbnormal> getOrderAbnormalList(@Param("defaultPage") Page<Object> defaultPage, @Param("orderAbnormalDTO") OrderAbnormalDTO orderAbnormalDTO, @Param("tenantId") Long tenantId);


    /**  异常解除  */
    void relieve(@Param("id") String id, @Param("relieveType") Integer relieveType, @Param("relieveUser") Long relieveUser);

    /**获取对应状态的异常订单信息*/
    List<OrderAbnormalVO> getOrderAbnormalVOListByOrderStatus(@Param("status") Integer status);

    int countByOrderIdAndType(@Param("orderId") Long orderId, @Param("type") Integer type, @Param("transportId") Long transportId);
}